/*!
	@file
	@author		George Evmenov
	@date		07/2009
*/

#ifndef __MYGUI_OPENGL_VERTEX_BUFFER_H__
#define __MYGUI_OPENGL_VERTEX_BUFFER_H__

#include "EGG/EGG.h"
#include "MyGUI_Prerequest.h"
#include "MyGUI_IVertexBuffer.h"

namespace MyGUI{

	class EggVertexBuffer : public IVertexBuffer{
	public:
		EggVertexBuffer();
		virtual ~EggVertexBuffer();
		virtual void setVertexCount(size_t _count);
		virtual size_t getVertexCount();
		virtual Vertex* lock();
		virtual void unlock();
		void destroy();
		void create();

        inline int getBufferID(){
            return mEggVertexBuffer->getID();
        }
        inline void draw(int count){
            mEggGeometry->draw(count);
        }
	private:
		size_t mVertexCount;
		size_t mNeedVertexCount;
		size_t mSizeInBytes;
        egg::GeometryPtr mEggGeometry;
        egg::VertexBufferPtr mEggVertexBuffer;
	};

} // namespace MyGUI

#endif // __MYGUI_OPENGL_VERTEX_BUFFER_H__
